var { Action } = require("../../base/index");
var { randomUtils, clickContent, clickUtils } = require("../../utils/index");
var pointMap = require("./pointMap");
var aTreasure = new Action("开宝箱", {});
aTreasure.exec = function () {
  var content = "立即签到";
  if (clickContent(content)) {
    sleep(randomUtils.getRandom(2, 5, 1000));
    return;
  }
  var content = "立即领取";
  if (clickContent(content)) {
    sleep(randomUtils.getRandom(2, 5, 1000));
    return;
  }
  var content = "点就领";
  if (clickContent(content)) {
    sleep(randomUtils.getRandom(2, 5, 1000));
    if (randomUtils.possible(90, 100)) {
      clickUtils.clickPointMap(pointMap.任务.点就领.关闭);
      sleep(randomUtils.getRandom(2, 5, 1000));
    }
    return;
  }
};
module.exports = aTreasure;
